import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 字符 排序 去重
 */

public class 字符排序去重 {

    public static void main(String[] args) {
        
        try{

            String str = "2123134214";
            List<String> strList = new ArrayList<>(str.length());

            for(char c : str.toCharArray()){
                
                strList.add(c+"");
            }

            List<String> distinctNumbers = strList.stream()
               .sorted()
               .distinct()
               .collect(Collectors.toList());

        System.out.println("原始列表：" + str);
        System.out.println("去除重复元素后的列表：" + distinctNumbers);

        }catch(Exception e){
            e.printStackTrace();
        }
    }
}